#ifndef LINEDETECT_H
#define	LINEDETECT_H

#include "LineInfo.h"
#include "opencv/cv.h"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/objdetect/objdetect.hpp"
#include "opencv2/imgproc/imgproc.hpp"


struct LineDetectInfo {
    cv::Rect ROI;
    int FilterHalf;
    int FilterThresshold;    
};

class LineDetect {
public:
    LineDetect(cv::Rect roi, int flterHalf, int filterThresshold);
    LineInfo* DetectHorizontalLine(cv::Mat imageMat);
    LineDetectInfo* LineDetectSetup;
    
private:
    int* IntensityLine;
    void CalculateIntensityLine(cv::Mat imageMat, int* intensityLine);
    LineInfo* EdgeFilter(int* intensityLine, int filterHalf);    
    int FilterFirstHalf(int* intensityLine, int filterHalf);
    int FilterSecondHalf(int* intensityLine, int filterHalf);
};

#endif	/* LINEDETECT_H */

